//
// Created by francklinson on 2021/10/24 AT 14:04.
//
#include <iostream>
#include <vector>
#include <unordered_map>
//using namespace std;
#include "Vector.h"

int main() {
#if 0
    std::vector<int> values{1, 2, 3, 4, 5};
    for (int i = 0; i < values.size(); ++i) {
        std::cout << values[i] << std::endl;
    }
    for (int value: values)
        std::cout << value << std::endl;

    for (std::vector<int>::iterator it = values.begin(); it != values.end(); ++it) {
        std::cout << *it << std::endl;
    }
    std::unordered_map<std::string, int> um;
    um["francklinson"] = 1;
    um["chalice"] = 2;
    for (const auto &kv: um) {
        std::cout << kv.first << " = " << kv.second << std::endl;
    }
    for (auto&[key, value]: um) {
        std::cout << key << " = " << value << std::endl;
    }

    return 0;
#endif
    Vector<std::string > values;
    values.EmplaceBack("1");
    values.EmplaceBack("2");
    values.EmplaceBack("Francklinson");
    values.EmplaceBack("4");
    values.EmplaceBack("5");
    std::cout << "Not using iterators:\n";
    for (int i = 0; i < values.Size(); ++i) {
        std::cout << values[i] << std::endl;
    }
    std::cout << "Range based for loop:\n";
    for (auto &value: values) {
        std::cout << value << std::endl;
    }
    std::cout << "Using iterator:\n";
    for (Vector<std::string>::Iterator it = values.begin(); it != values.end(); ++it) {
        std::cout << *it << std::endl;
    }

}

